home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.40 / ham-demo / ham-demo.p < prev    next >
Text File  |  1994-12-11  |  1KB  |  76 lines

  1. {Programm: HAM-Demo
  2.  Sinn:     zeigt einfachen Umgang mit HAM-Modus und 4096 Farben
  3.  Author:   für KP/MP3: PackMAN, Falk Zühlsdorff                    }
  4.  
  5. PROGRAM HamDemo;
  6. USES INTUITION,GRAPHICS;
  7. TYPE FarbenType = ARRAY[1..8] OF WORD;
  8. VAR  Farben     : Farbentype;
  9.      Scr        : p_Screen;
  10.      Win        : p_Window;
  11.      RP         : p_RastPort;
  12.      i,j        : INTEGER;
  13.  
  14. BEGIN
  15.   Farben:=FarbenType(0,3840,240,0,2056,3855,3840,15);
  16.  
  17.   Scr:=NIL;Win:=NIL;
  18.  
  19.   Scr:=Open_Screen
  20.         (0,0,320,256,6,0,1,HAM,"HAM-Demo © by PackMAN 4 Purity");
  21.  
  22.   IF Scr=NIL THEN exit;
  23.  
  24.   Win:=Open_Window(0,10,320,246,$0001,MOUSEBUTTONS,ACTIVATE+
  25.                    BORDERLESS,NIL,Scr,0,0,0,0);
  26.  
  27.   IF Win=NIL THEN BEGIN Close_Screen(Scr); Exit;END;
  28.  
  29.   RP:=Win^.RPort;
  30.  
  31.   LoadRGB4(^Scr^.viewPort,^Farben,8);
  32.  
  33.   SetAPen(RP,3);
  34.   RectFill(RP,69,47,241,209);
  35.  
  36.   FOR i:=0 TO 15 DO
  37.    BEGIN
  38.     SetAPen(RP,32+i);
  39.     RectFill(RP,70,i*10+48,80,i*10+58);
  40.  
  41.     FOR j:=0 TO 15 DO
  42.      BEGIN
  43.       SetAPen(RP,j+16);
  44.       RectFill(RP,10+j*10+70,i*10+48,20+j*10+70,i*10+58);
  45.      END;
  46.    END;
  47.  
  48.   delay(50);
  49.  
  50.   { Nun wird langsam die Grünkomponente erhöht ... }
  51.  
  52.   FOR j:=0 TO 15 DO
  53.    BEGIN
  54.     SetRGB4(^Scr^.ViewPort,3,0,j,0);
  55.     Delay(20);
  56.    END;
  57.  
  58.   Delay(150);
  59.  
  60.   { ... und wieder zurückgesetzt! }
  61.  
  62.   FOR j:=15 TO 0 DO
  63.    BEGIN
  64.     SetRGB4(^Scr^.viewPort,3,0,j,0);
  65.     Delay(20);
  66.    END;
  67.  
  68.   Delay(70);
  69.  
  70.   Close_Window(Win);
  71.   Close_Screen(Scr);
  72. END.
  73.  
  74.  
  75.  
  76.